package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import main.DataTransferObject;
import main.MyConnection;

/**
 * This is the ternary Relationship table between the 
 * User, Location, and Algorithm tables.
 * 
 * @author Brad
 */
public interface AccessesDAO {


	/**
	 * Use this method to create a new Entry in the database. 
	 * The input DTO must have the 
	 * 		1.  Username
	 * 		2.  Algorithm Name
	 *      3.  IP
	 * set in order to correctly save to the database.  If no datetime is
	 * set in the input DTO, then it will default to the current timestamp
	 * of this applications timezone.
	 * 
	 * @param inDTO
	 * @return boolean whether it was successful or not...
	 */
	public boolean createEntry(DataTransferObject inDTO);

	/**
	 * Returns all the data on the database.
	 * @return A list of all the DataTransferObject.
	 */
	public List<DataTransferObject> getAllData();

	/**
	 * Returns all the data in the database sorted by Country, then by City, then by Algorithm
	 * @return A sorted list of all the DataTransferObject.
	 */
	public List<DataTransferObject> getCountryCityAlgorithm();

	/**
	 * Returns all the data in the database sorted by Algorithm, then by Country, then by City
	 * @return A sorted list of all the DataTransferObject.
	 */
	public List<DataTransferObject> getAlgorithmCountryCity();

	/**
	 * Returns all the data in the database sorted by Country, then by City, then by User
	 * @return A sorted list of all the DataTransferObject.
	 */
	public List<DataTransferObject> getCountryCityUser();
	
}
